using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._CrimeAnalysisandSafetyTools
{
    /// <summary>
    /// <para>80-20 Analysis</para>
    /// <para>Conducts an 80/20 analysis of features and determines cluster locations by creating a graduated symbol layer based on the number of incidents occurring at each location. The tool calculates a cumulative percentage field to identify the locations where incidents are disproportionately occurring.</para>
    /// <para>对要素进行 80/20 分析，并通过根据每个位置发生的事件数创建分级符号图层来确定聚类位置。该工具计算累积百分比字段，以识别事件不成比例发生的位置。</para>
    /// </summary>    
    [DisplayName("80-20 Analysis")]
    public class EightyTwentyAnalysis : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public EightyTwentyAnalysis()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Point Features</para>
        /// <para>The input point features used to create clusters.</para>
        /// <para>用于创建集群的输入点要素。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The output point cluster feature class.</para>
        /// <para>输出点聚类要素类。</para>
        /// </param>
        public EightyTwentyAnalysis(object _in_features, object _out_feature_class)
        {
            this._in_features = _in_features;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "Crime Analysis and Safety Tools";

        public override string ToolName => "80-20 Analysis";

        public override string CallName => "ca.EightyTwentyAnalysis";

        public override List<string> AcceptEnvironments => ["MDomain", "MResolution", "MTolerance", "XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "autoCommit", "configKeyword", "extent", "geographicTransformations", "maintainAttachments", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "qualifiedFieldNames", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_features, _out_feature_class, _cluster_tolerance, _out_fields];

        /// <summary>
        /// <para>Input Point Features</para>
        /// <para>The input point features used to create clusters.</para>
        /// <para>用于创建集群的输入点要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Point Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The output point cluster feature class.</para>
        /// <para>输出点聚类要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Cluster Tolerance</para>
        /// <para><xdoc>
        ///   <para>The maximum distance (meters, feet, kilometers, or miles) separating the points at which they will be considered part of the same cluster.</para>
        ///   <para>If no cluster tolerance is specified, the tool will identify features that are geometrically identical to cluster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将点视为同一聚类一部分的点之间的最大距离（米、英尺、公里或英里）。</para>
        ///   <para>如果未指定聚类容差，则该工具将识别与聚类几何相同的要素。</para>
        /// </xdoc></para>
        /// <para>单位： Meters | Kilometers | Miles | Feet </para>
        /// </summary>
        [DisplayName("Cluster Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _cluster_tolerance { get; set; } = null;


        /// <summary>
        /// <para>Output Fields</para>
        /// <para>The input feature fields that will be preserved. When no fields are preserved, no input feature fields will be copied to the output. This is the default behavior.</para>
        /// <para>将保留的输入要素字段。如果未保留任何字段，则不会将任何输入要素字段复制到输出中。这是默认行为。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _out_fields { get; set; } = null;


        public EightyTwentyAnalysis SetEnv(object MDomain = null, object MResolution = null, object MTolerance = null, object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, int? autoCommit = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, bool? qualifiedFieldNames = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(MDomain: MDomain, MResolution: MResolution, MTolerance: MTolerance, XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, autoCommit: autoCommit, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, qualifiedFieldNames: qualifiedFieldNames, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}